{% extends "mybase2.html" %}

{% block title %} 用户中心 {% endblock %}

{% block style %}
    {{ super() }}
    <style>

        #container {
            display: flex;
            background-color: skyblue;
        }

        #right {
            width: 70%;
            height: 600px;
            background-color: skyblue;
            opacity: 0.5;
        }

        #right:first-child{
            margin-top: 20px;
        }
        #left {
            display: block;
        }

    </style>
{% endblock %}


{% block content %}
<div id="container">
    <div id="left">
        <p>用户信息修改</p>
        <p>发表文章</p>
        <p>管理相册</p>
        <p>管理留言</p>
        <p>关于我设置</p>
    </div>


    <div id="right">
        <div class="right1">
            <h2>用户信息修改</h2>

            <form class="form-horizontal" action="{{ url_for('user.user_change') }}" method="post" enctype="multipart/form-data" >
                <div class="form-group row">
                    <label for="inputUsername" class="col-md-2 col-form-label">用户名</label>
                    <div class="col-md-4">
                        <input type="text" class="form-control" id="inputUsername" name="username" value="{{ g.user.username }}">
                    </div>
                </div>

                    <div class="form-group row">
                    <label for="inputPhone" class="col-md-2 col-form-label">手机号</label>
                    <div class="col-md-4">
                        <input type="text" class="form-control" id="inputPhone" name="phone" value="{{ g.user.phone }}">
                    </div>
                </div>

                <div class="form-group row">
                    <label for="inputEmail" class="col-md-2 col-form-label">email</label>
                    <div class="col-md-4">
                        <input type="text" class="form-control" id="inputEmail" name="email" value="{{ g.user.email }}">
                    </div>
                </div>

                <div class="form-group row">
                    <label for="inputIcon" class="col-md-2 col-form-label">上传头像</label>
                    <div >
                        <label ><input type="file" id="exampleInputFile" name="icon"></label>
                    </div>
                </div>

                <div class="form-group row">
                    <label for="icon" class="col-md-2 col-form-label">头像</label>
                    <div class="col-md-4">
                        <img src="{% if user.icon %} {{ url_for('static', filename=user.icon) }}
                        {% else %} {{ url_for('static', filename='images/default.png') }} {% endif %}" 
                        alt="" width="100" height="100">
                    </div>                       
                </div>
                <p> <button type="submit" class="btn btn-primary">用户信息修改</button></p>
            </form>
        
        </div>
        <div class="right1" style="padding-top:20px">
            <form action="{{ url_for('user.publish_article') }}" method="post">
                <p><input type="text" class="form-control" id="InputFile" name="title" placeholder="请输入文章标题">
                </p>
                <p>
                    <select name="type" class="form-control">
                        <option value="0">请选择文章分类</option>
                        <option value="1">程序人生</option>
                        <option value="2">慢生活</option>
                        <option value="3">生活随笔</option>
                    </select>
                </p>
                <p>
                    <textarea name="content" class="mytextarea">

                    </textarea>
                </p>

                <p></p>
                <p style="text-align:right">
                    <button type="submit" class="btn btn-primary">发表文章</button>
                </p>
            </form>

        </div>
        <div class="right1" style="background-color:#00ff80"></div>
        <div class="right1" style="background-color:darkgreen"></div>
        <div class="right1" style="padding-top:30px"></div>
        
    </div>
       
</div>
{% endblock %}

{% block script %}
    {{ super() }}

    <script src="{{ url_for('static', filename='tinymce/tinymce.min.js') }}"></script>
    <script src="{{ url_for('static', filename='js/center.js') }}"></script>
    <script>
       

    </script>
{% endblock %}